﻿@model IEnumerable<Weapsy.Reporting.Pages.PageAdminListModel>

@{
    ViewBag.Title = Localizer["Title"];
}

@section scripts{
    <script src="~/js/admin/pages/index.js"></script>   

}

<div class="page-header">
    <h1>@Localizer["Title"]</h1>
</div>

<table class="table table-striped table-bordered table-hover">
    <thead>
        <tr>
            <th>Name</th>
            <th>Url</th>
            <th class="text-center">Active</th>
            <th class="text-center">&nbsp;</th>
        </tr>
    </thead>
    <tbody>
    @foreach (var pg in Model)
    {
        <tr>
            <td>@pg.Name</td>
            <td>@pg.Url</td>
            <td class="text-center">
                <input type="checkbox" @(pg.Status == Weapsy.Domain.Pages.PageStatus.Active ? "checked=\"checked\"" : "") data-page-id="@pg.Id" class="activate-page" />
            </td>
            <td class="text-center">
                <a href="@Url.Action("Edit", "Page", new { area = "Admin", id = pg.Id })" class="glyphicon glyphicon-edit options" title="Edit"></a>
                <a href="#" class="glyphicon glyphicon-remove options delete-page" data-toggle="modal" data-target="#confirm-delete" data-id="@pg.Id" title="Delete"></a>
            </td>
        </tr>
    }
    </tbody>
</table>

<div>
    <a href="@Url.Action("Create", "Page", new { area = "Admin" })" class="btn btn-primary" title="New Page">New Page</a>
</div>

@await Html.PartialAsync("_ConfirmDelete")